<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="">
    <style>
        body {
            background-color: #fff;
        }
    </style>
</head>

<body>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</body>
<script>
    // console.log(1);
    // console.log(2);
    // console.log(3);

    for (let i = 0; i < 100; i++) {
        document.addEventListener("click", function () {
            console.log(i);
        })
        setTimeout(function () {
            console.log(i);
        }, Math.round(Math.random() * 1000));
    }
    // console.log("执行完毕", i);
</script>

</html>